ComponentOne Splitter for ASP.NET Web Forms
Task-Based Help / Setting C1Splitter Behaviors / Setting a Minimum Size for a Splitter Panel
In This Topic
    Setting a Minimum Size for a Splitter Panel
    In This Topic

    In some instances, you might want to keep users from resizing a panel past a certain point. In Panel1, for example, you may have a stack of buttons that you want visible at all times. When confronted with that sort of situation, you can use the SplitterPanel.MinSize property to specify, in pixels, the size of the area that you don't want users to drag past. In this topic, you will learn how to set the  SplitterPanel.MinSize property in Design view, in Source view, and in Code.

    In Design View

    Complete the following steps:

    1. Add C1Splitter to the Web form.
    2. Right-click on the control and select Properties. In the Properties window, expand the Panel1 node.
    3. Set the  SplitterPanel.MinSize property for Panel1 to "30".
    4. Save and run your project.

    In Source View

    To make Panel1 a fixed-size panel, place <Panel1 MinSize="30"></Panel1> between the <cc1:C1Splitter> and </cc1:C1Splitter> tags. Once the SplitterPanel.MinSize property has been set, the markup will resemble the following:

    <cc1:C1Splitter ID="C1Splitter6" runat="server" Height="251px" Width="217px" SplitterDistance="50">
    <Panel1 MinSize="30">
    </Panel1>
    </cc1:C1Splitter>

    In Code

    Complete the following steps:

    1. Import the following namespace into your project:

      To write the code in Visual Basic:

        
      Visual Basic
      Copy Code
      Imports C1.Web.Wijmo.Controls.C1Splitter

      To write the code in C#:

        
      C#
      Copy Code
      using C1.Web.Wijmo.Controls.C1Splitter;
    2. Add the following code, which sets the SplitterPanel.MinSize property, to the Page_Load event:

      To write the code in Visual Basic:

        
      Visual Basic
      Copy Code
      C1Splitter1.Panel1.MinSize = 30

      To write the code in C#:

        
      C#
      Copy Code
      C1Splitter1.Panel1.MinSize = 30;
    3. Run the program.

    This Topic Illustrates the Following:

    Once you've built the project, drag the splitter bar to the left and observe that it sticks at 30 pixels. 

    See Also